﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Photon.SocketServer;

namespace MyApplication
{
    /// <summary>
    /// 聊天管理类
    /// 
    /// 1 敏感词过滤
    /// 2 历史聊天记录存储
    /// </summary>
    public class ChatManager : IDisposable
    {
        private static ChatManager mSingle = new ChatManager();
        private ChatManager()
        { }

        public static ChatManager Single
        {
            get { return mSingle; }
        }

        private List<string> mList = new List<string>();

        public void AddChat(string chat)
        {
            mList.Add(chat);
        }

        public void ClearAll()
        {
            mList.Clear();
        }

        public String[] GetChats()
        {
            return mList.ToArray();
        }

        public void Dispose()
        {
            this.ClearAll();
        }
    }
}
